<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        a{
            text-decoration: none;
        }
        li{
            width: 30px;
            height: 30px;
            list-style: none;
            
        }
        ul{
            display: flex;
            width: 200px;
            justify-content: flex-start;
        }
        .box{
            width: 500px;
            height: 500px;
            margin: auto;
        }
    </style>
</head>
<body>
   <div class="box">
    <ul>
        <li style="background-color:rgb(255, 0, 149);" onclick="b_r()"></li>
        <li style="background-color:rgb(174, 255, 0);" onclick="b_g()"></li>
        <li style="background-color:rgb(0, 255, 255);" onclick="b_b()"></li>
     
    </ul>
    <table width="400px" cellspacing="0" border="1">
       <th><a href="#">新闻</a> </th>
       <th><a href="#">娱乐</a> </th>
       <th><a href="#">体育</a> </th>
       <th><a href="#">电影</a> </th>
       <th><a href="#">音乐</a> </th>
       <th><a href="#">旅游</a> </th>
    </table>
   </div>
</body>
</html>
<script type="text/javascript">
    
    var body = document.querySelector("body")
    function b_r(){
            body.style.background="rgb(255, 0, 149)"
    }
    function b_g(){
            body.style.background="rgb(174, 255, 0)"
    }
    function b_b(){
            body.style.background="rgb(0, 255, 255)"
    }
</script>